package com.schedule.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schedule.mapper.RoleMapper;
import com.schedule.pojo.Role;
import com.schedule.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author star
 * @since 2022-02-12
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

    /**
     * 根据名字插在角色
     * @return
     */
    @Override
    public Role getRoleByName(String name) {
        return roleMapper.selectOne(new QueryWrapper<Role>()
                .eq("nameZh", name));
    }
}
